<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>教师信息管理系统</title>
    <link rel="stylesheet" href="/css/layui.css">
    <script src="/js/jquery-3.7.1.min.js"></script>
    <link rel="stylesheet" href="/css/dp3.css">
</head>
<body>

<div class="container">
    <div class="layui-row">
        <div class="layui-col-xs12">
            <h1 style="text-align: center">教师信息管理系统</h1>
        </div>
    </div>

    <!-- 工具栏 -->
    <div class="layui-row">
        <!-- 工具栏 -->
        <div class="layui-col-xs12 toolbar">
            <!-- 左侧新增按钮 -->
            <div style="float: left;">
                <button type="button" class="layui-btn layui-btn-sm layui-btn-normal"
                        onclick="showStudentDlg();return false;">
                    <i class="layui-icon layui-icon-addition"></i> 新增
                </button>
            </div>

            <!-- 右侧搜索区域 -->
            <div style="float: right;">
                <div class="layui-inline" style="margin-right: 10px;">
                    <input type="text" id="searchInput" placeholder="请输入姓名或ID" autocomplete="off" class="layui-input">
                </div>
                <button type="button" id="searchBtn" class="layui-btn layui-btn-sm">
                    <i class="layui-icon layui-icon-search"></i> 搜索
                </button>
            </div>

            <!-- 清除浮动 -->
            <div style="clear: both;"></div>
        </div>
    </div>

    <!-- 搜索结果弹窗（初始化时隐藏） -->
    <div id="searchResultDialog" style="display:none; padding: 15px;">
        <table class="layui-table" id="searchResultTable">
            <thead>
            <tr>
                <th>ID</th>
                <th>姓名</th>
                <th>性别</th>
                <th>年龄</th>
                <th>工号</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody id="searchResultBody"></tbody>
        </table>
    </div>



    <!-- 表格区域 -->
    <div class="layui-row">
        <div class="layui-col-xs12">
            <table class="layui-hide" id="ID-table-demo-filter"></table>
            <table class="layui-table" lay-even>
                <thead>
                <tr>
                    <th>id</th>
                    <th>姓名</th>
                    <th>性别</th>
                    <th>年龄</th>
                    <th>工号</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody id="studentTb"></tbody>
            </table>
        </div>
    </div>
</div>

<!-- 新增/编辑弹窗表单 -->
<form class="layui-form dlgcontainer" id="studForm" style="display: none;">
    <div class="demo-reg-container">
        <div class="layui-form-item" id="formid">
            <div class="layui-row">
                <div class="layui-col-xs12">
                    <div class="layui-input-wrap">
                        <div class="layui-input-prefix">
                            <i class="layui-icon layui-icon-cellphone"></i>
                        </div>
                        <input type="text" name="id" placeholder="id" autocomplete="off"
                               class="layui-input" id="id">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-wrap">
                <div class="layui-input-prefix">
                    <i class="layui-icon layui-icon-vercode"></i>
                </div>
                <input type="text" name="sno" lay-verify="required" placeholder="工号"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-wrap">
                <div class="layui-input-prefix">
                    <i class="layui-icon layui-icon-password"></i>
                </div>
                <input type="text" name="name" lay-verify="required" placeholder="姓名"
                       autocomplete="off" class="layui-input" id="name">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-wrap">
                <label class="layui-form-label">性别</label>
                <div class="layui-input-block">
                    <input type="radio" name="sex" value="1" title="男" checked>
                    <input type="radio" name="sex" value="2" title="女">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-wrap">
                <div class="layui-input-prefix">
                    <i class="layui-icon layui-icon-username"></i>
                </div>
                <input type="text" name="age" placeholder="年龄" autocomplete="off"
                       class="layui-input" lay-affix="clear">
            </div>
        </div>
        <div class="layui-form-item">
            <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="stud-dlg" id="btnOK">确定</button>
        </div>
    </div>
</form>

<!-- 查询弹窗 -->
<div id="searchDialog" style="display: none; padding: 20px;">
    <form class="layui-form" id="searchForm">
        <div class="layui-form-item">
            <label class="layui-form-label">查询方式</label>
            <div class="layui-input-block">
                <select name="searchType" lay-verify="required">
                    <option value="id">按ID查询</option>
                    <option value="name">按姓名模糊查询</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">关键词</label>
            <div class="layui-input-block">
                <input type="text" name="keyword" placeholder="请输入关键词"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" style="text-align: center;">
            <button class="layui-btn" lay-submit lay-filter="doSearch">查询</button>
        </div>
    </form>
</div>

<script src="/js/layui.js"></script>
<script src="/pagejs/dp01.js"></script>
</body>
</html>
